#ifndef SHADER_H
#define SHADER_H

#include <string>
#include "bga/graphics/GLObject.h"

/**
 * \namespace bga
 * \brief API namespace
 */
namespace bga
{

class BOARD_HELL_ENGINE Shader : public GLObject
{
    public:
        /// TODO : To kick out of the class :p
        enum TypeShader
        {
            VERTEX_SHADER,
            FRAGMENT_SHADER
        };

        Shader();
        Shader(const std::string& filename, TypeShader type = FRAGMENT_SHADER);
        virtual ~Shader();

        void compil();

        TypeShader getType() const { return this->type; }

        virtual void bind() const {}
        virtual void unbind() const {}

    protected:
        virtual GLuint generate() const { return GL_NONE; }

    private:
        std::string filename;
        std::string source;
        TypeShader type;

    private:
        void parseShader();
        void create();
        void destroy();
};

}
#endif
